
#ifndef _BOARD_CONFIG_H_
#define _BOARD_CONFIG_H_

#include <driver/gpio.h>

// 音频
#define AUDIO_INPUT_SAMPLE_RATE  24000
#define AUDIO_OUTPUT_SAMPLE_RATE 24000

#define AUDIO_INPUT_REFERENCE    true
#define AUDIO_I2S_GPIO_WS GPIO_NUM_41
#define AUDIO_I2S_GPIO_MCLK GPIO_NUM_12
#define AUDIO_I2S_GPIO_BCLK GPIO_NUM_13
#define AUDIO_I2S_GPIO_DIN  GPIO_NUM_14
#define AUDIO_I2S_GPIO_DOUT GPIO_NUM_45

#define AUDIO_CODEC_PA_PIN GPIO_NUM_21
#define AUDIO_CODEC_I2C_SDA_PIN  GPIO_NUM_1
#define AUDIO_CODEC_I2C_SCL_PIN  GPIO_NUM_2
#define AUDIO_CODEC_ES8311_ADDR  ES8311_CODEC_DEFAULT_ADDR

// 按键
#define BOOT_BUTTON_GPIO        GPIO_NUM_0

// 屏幕
#define DISPLAY_SPI_HOST SPI3_HOST
#define DISPLAY_SDA GPIO_NUM_39
#define DISPLAY_SCL GPIO_NUM_40
#define DISPLAY_DC GPIO_NUM_38
#define DISPLAY_CS GPIO_NUM_NC
#define DISPLAY_RES GPIO_NUM_NC
#define DISPLAY_WIDTH   240
#define DISPLAY_HEIGHT  240
#define DISPLAY_SWAP_XY  false
#define DISPLAY_MIRROR_X false
#define DISPLAY_MIRROR_Y false
#define BACKLIGHT_INVERT false
#define DISPLAY_OFFSET_X  0
#define DISPLAY_OFFSET_Y  0
#define DISPLAY_BACKLIGHT_PIN GPIO_NUM_11
#define DISPLAY_BACKLIGHT_OUTPUT_INVERT false

// 4g
#define NETWORK_MODULE_POWER_IN GPIO_NUM_NC
#define ML307_RX_PIN GPIO_NUM_47
#define ML307_TX_PIN GPIO_NUM_48
#define NETWORK_ZXC GPIO_NUM_NC

// 电源管理
#define POWER_USB_IN GPIO_NUM_NC
#define Power_Control GPIO_NUM_NC
#define Power_Dec GPIO_NUM_NC
#define POWER_CBS_ADC_UNIT ADC_UNIT_1   // battery adc检测unit GPIO10
#define POWER_BATTERY_ADC_CHANNEL ADC_CHANNEL_9 // 电池电量检测 GPIO10

/* Camera pins */
#define CAMERA_PIN_PWDN -1
#define CAMERA_PIN_RESET -1
#define CAMERA_PIN_XCLK 5
#define CAMERA_PIN_SIOD 1
#define CAMERA_PIN_SIOC 2

#define CAMERA_PIN_D7 9
#define CAMERA_PIN_D6 4
#define CAMERA_PIN_D5 6
#define CAMERA_PIN_D4 15
#define CAMERA_PIN_D3 17
#define CAMERA_PIN_D2 8
#define CAMERA_PIN_D1 18
#define CAMERA_PIN_D0 16
#define CAMERA_PIN_VSYNC 3
#define CAMERA_PIN_HREF 46
#define CAMERA_PIN_PCLK 7

#define XCLK_FREQ_HZ 24000000

// sd crad
#define SDCARD_PIN_CS GPIO_NUM_NC
#define SDCARD_PIN_MOSI 43
#define SDCARD_PIN_MISO 44
#define SDCARD_PIN_CLK 42
#define MOUNT_POINT "/sdcard"
#define SDCARD_SPI_HOST SPI2_HOST
#endif // _BOARD_CONFIG_H_
